import request from '../common/request.js';
import requestl from '../common/requestl.js';

//读取配置的网站参数
export function getWebInfo(params) {
	return request({
		url: '/appConfig/dataByTypeKey',
		method: 'get',
		data: params
	})
}

// 获取推荐码
export function getUsedCode(params) {
	return request({
		url: '/user/getUsedCode',
		method: 'post',
		data: params
	})
}

// 商户申购信息查询
export function getUserPurchaseInfo(params) {
	return request({
		url: '/user/getUserPurchaseInfo',
		method: 'post',
		data: params
	})
}

// 查询渠道邀请码是否存在
export function getByAgentChannelCode(params) {
	return request({
		url: '/user/byAgentChannelCode',
		method: 'post',
		data: params
	})
}

// 补充邀请码和渠道邀请码
export function setReferralCode(params) {
	return request({
		url: '/user/setReferralCode',
		method: 'post',
		data: params
	})
}

// 生成推荐码
export function getReferralCode(params) {
	return request({
		url: '/user/getReferralCode',
		method: 'post',
		data: params
	})
}

//获取用户信息
export function getUser(sendParam) {
	return request({
		url: '/user/getUser',
		method: 'post',
		data: sendParam
	})
}

//用户站内信信息-分页查询
export function getUserNftusermsg(data) {
	return request({
		url: '/cdwjs/nftusermsg/list',
		method: 'post',
		data
	})
}

// 头像设置
export function setHeadPortrait(data) {
	return request({
		url: '/user/setHeadPortrait',
		method: 'post',
		data
	})
}

// 昵称设置
export function updateNickName(data) {
	return request({
		url: '/user/updateNickName',
		method: 'post',
		data
	})
}

export function sendPhonePswCode(data) { //设置密码发送手机验证码
	return request({
		url: '/sms/user/sendPhonePswCode',
		method: 'post',
		data
	})
}

export function sendcheckMobile(data) { //修改手机号-验证已绑定手机号
	return request({
		url: '/user/checkMobile',
		method: 'post',
		data
	})
}

export function setUserPsw(data) { //登录密码设置
	return request({
		url: '/user/setPsw',
		method: 'post',
		data
	})
}

// 实名认证
export function setRealName(data) {
	return request({
		url: '/user/setRealName',
		method: 'post',
		data
	})
}

// 我的藏品
export function findUserNftPage(data) {
	return request({
		url: '/order/nftorder/findUserNftPage',
		method: 'post',
		data
	})
}

//用户收藏关注信息-分页查询
export function getCollectionList(data) {
	return request({
		url: '/cdwjs/nftuserlike/list',
		method: 'post',
		data
	})
}

// 我的藏品
export function getUserInfo(data) {
	return request({
		url: '/user/getUserInfo',
		method: 'post',
		data
	})
}

// 我的
export function getUserInfoNum(data) {
	return request({
		url: '/user/getUserInfo/v2',
		method: 'post',
		data
	})
}


// 用户资产信息-分页查询
export function getNftuserassets(data) {
	return request({
		url: '/user/nftuserassets/list',
		method: 'post',
		data
	})
}

// 兑换码 
export function exchange(data) {
	return request({
		url: '/order/nftorder/exchange',
		method: 'post',
		data
	})
}

// 订单管理-分页查询v2
export function nftorderList(data) {
	return request({
		url: '/order/nftorder/list/v2',
		method: 'post',
		data
	})
}

// 兑换码 
export function getResaleorder(data) {
	return request({
		url: '/cdwjs/bank/nftresaleorder/list',
		method: 'post',
		data
	})
}

// 积分账户明细
export function integralList(data) {
	return request({
		url: '/integral/appintegralaccountrecord/list',
		method: 'post',
		data
	})
}

// 用户资产信息-id查询
export function getMyGoodsDetail(data) {
	return request({
		url: `/user/nftuserassets/get/${data.id}`,
		method: 'get',
		data
	})
}

// 转售市场挂单信息-id查询
export function getGoodsDetail(data) {
	return request({
		url: `/cdwjs/nftresalepaying/get/${data.id}`,
		method: 'get',
		data
	})
}

// 用户挂单信息-分页查询
export function getMyGoodsList(data) {
	return request({
		url: `/user/nftuserassets/paying/list`,
		method: 'post',
		data
	})
}

// 出售
export function sellGoods(data) {
	return request({
		url: `/user/nftuserassets/sell/v2`,
		method: 'post',
		data,
	})
}

// 下架
export function offGoods(data) {
	return request({
		url: `/user/nftuserassets/off`,
		method: 'post',
		data,
	})
}

// 转售市场藏品信息
export function getResaleCasting(data) {
	return request({
		url: `/cdwjs/nftresalecasting/getResaleCasting`,
		method: 'post',
		data,
	})
}

//转售市场订单信息-下单
export function nftresaleorder(data) {
	return request({
		url: `/cdwjs/bank/nftresaleorder/add`,
		method: 'post',
		data,
	})
}

//开通子账户
export function dsbankuserAdd(data) {//平台通宝子账户信息-开通子账号
	return request({
		url: `/cdwjs/bank/dsbankuser/add/v2`,
		method: 'post',
		data,
	})
}

export function dsbankcardAdd(data) {//平台通宝子账户出入金信息-绑卡
	return request({
		url: `/cdwjs/bank/dsbankcard/add`,
		method: 'post',
		data,
	})
}

export function getAccountData(data) {//平台通宝子账户出入金信息-分页查询
	return request({
		url: `/cdwjs/bank/dsbankuser/getUser`,
		method: 'get',
		data,
	})
}

export function getUserBank(data) {//平台通宝子账户出入金信息-分页查询
	return request({
		url: `/cdwjs/bank/dsbankcard/list`,
		method: 'post',
		data,
	})
}

export function removeUserBank(data) {//平台通宝子账户信息-id删除
	return request({
		url: `/cdwjs/bank/dsbankuser/remove/${data.id}`,
		method: 'post',
		data,
	})
}

//用户收藏关注(取消）
export function nftuserlike(data) {
	return request({
		url: `/cdwjs/nftuserlike/add`,
		method: 'post',
		data,
	})
}

//查询文章分类
export function getNewsList(data) {
	return request({
		url: `/appConfig/findArticleCategory`,
		method: 'get',
		data,
	})
}

//查询文章详情-id查询
export function getNewsDetails(data) {
	return request({
		url: `/appConfig/getArticle`,
		method: 'get',
		data,
	})
}

//查询文章详情-id查询
export function getNewsPageDetails(data) {
	return request({
		url: `/appConfig/findSinglePage`,
		method: 'post',
		data,
	})
}

//用户余额明细信息-分页查询
export function getuserbalancelog(data) {
	return request({
		url: `/cdwjs/nftuserbalancelog/list`,
		method: 'post',
		data,
	})
}

//发送手机验证码
export function getSendPhoneCode(data) {
	return request({
		url: `/sms/user/sendUpdatePhone`,
		method: 'post',
		data,
	})
}

//发送手机验证码
export function sendPhoneCode(data) {
	return request({
		url: `/sms/sendPhoneCode`,
		method: 'post',
		data,
	})
}

//修改手机号-设置新的手机号
export function updateMobile(data) {
	return request({
		url: `/user/updateMobile`,
		method: 'post',
		data,
	})
}

//平台通宝子账户信息-设置支付密码
export function setPayPsw(data) {
	return request({
		url: `/cdwjs/bank/dsbankuser/setPayPsw`,
		method: 'post',
		data,
	})
}

//实名认证InitFaceVerify
export function initFaceVerify(data) {
	return request({
		url: `/cdwjs/bank/dsbankuser/InitFaceVerify`,
		method: 'post',
		data,
	})
}

//服务费计算
export function countService(data) {
	return request({
		url: `/cdwjs/bank/nftresaleorder/countService`,
		method: 'post',
		data,
	})
}

//根据资产id计算服务费
export function countAssestService(data) {
	return request({
		url: `/cdwjs/bank/nftresaleorder/countAssestService`,
		method: 'post',
		data,
	})
}

//用户反馈建议-添加
export function addFreedback(data) {
	return request({
		url: `/cdwjs/base/dsadvice/add`,
		method: 'post',
		data,
	})
}

//用户反馈建议-分页查询
export function getFreedbackList(data) {
	return request({
		url: `/cdwjs/base/dsadvice/list`,
		method: 'post',
		data,
	})
}

//副本流转记录-分页查询
export function getNftuserdetaillogList(data) {
	return request({
		url: `/cdwjs/base/nftuserdetaillog/list`,
		method: 'post',
		data,
	})
}

//查询资金账户信息
export function appfundaccountGetDetail(data) {
	return request({
		url: `/fund/appfundaccount/getDetail`,
		method: 'post',
		data
	})
}

//资金账户明细管理-分页查询
export function appfundaccountList(data) {
	return request({
		url: `/fund/appfundaccount/list`,
		method: 'post',
		data,
	})
}

//资金账户信息-充值
export function appfundaccountRecharge(data) {
	return request({
		url: `/fund/appfundaccount/recharge`,
		method: 'post',
		data,
	})
}

//资金账户信息-提现
export function appfundaccountWithdrawal(data) {
	return request({
		url: `/fund/appfundaccount/withdrawal`,
		method: 'post',
		data,
	})
}

// 资金账户信息-基础配置信息
export function appfundaccountGetRwConfig(data) {
	return request({
		url: `/fund/appfundaccount/getRwConfig`,
		method: 'post',
		data,
	})
}

// 个人银行卡管理-分页查询
export function appcustomerbankcardList(data) {
	return request({
		url: `/bank/appcustomerbankcard/list`,
		method: 'post',
		data,
	})
}
// 个人银行卡管理-分页查询
export function appuserzhifubaoList(data) {
	return request({
		url: `/fund/appuserzhifubao/list`,
		method: 'post',
		data,
	})
}

// 个人银行卡管理-分页查询
export function appcustomerbankcardGet(data) {
	return request({
		url: `/bank/appcustomerbankcard/get/${data.id}`,
		method: 'get',
		data,
	})
}

// 个人银行卡管理-绑卡
export function appcustomerbankcardBindingCard(data) {
	return request({
		url: `/bank/appcustomerbankcard/bindingCard`,
		method: 'post',
		data,
	})
}

// 设置支付密码
export function saveAccountPassword(data) {
	return request({
		url: `/user/saveAccountPassword`,
		method: 'post',
		data,
	})
}


// 修改支付密码
export function updateAccountPassword(data) {
	return request({
		url: `/user/updateAccountPassword`,
		method: 'post',
		data,
	})
}

// 获取RSA加密公钥
export function getPublicKey() {
	return request({
		url: '/reg/getPublicKey',
		method: 'post'
	})
}

// 验证手机验证码
export function checkCode(data) {
	return request({
		url: '/user/checkCode',
		method: 'post',
		data
	})
}

// 修改登录密码
export function updatePassword(data) {
	return request({
		url: '/user/updatePassword',
		method: 'post',
		data
	})
}

// 解绑银行卡
export function unbindingCard(data) {
	return request({
		url: '/bank/appcustomerbankcard/unbindingCard',
		method: 'post',
		data
	})
}
// 解绑支付宝
export function unbindingZhifubao(data) {
	return request({
		url: '/fund/appuserzhifubao/unbindingZhifubao',
		method: 'post',
		data
	})
}
// 获取限制金额
export function getLimitMoney() {
	return request({
		url: '/fund/appfundaccount/getLimitMoney',
		method: 'get',
	})
}
// 获取提现参数
export function getWithdrawal() {
	return request({
		url: '/fund/appfundaccount/getWithdrawal',
		method: 'get',
	})
}

